package com.nondo.dean.auth.mapper;

import com.nondo.dean.auth.domain.RoleAuthorityExample;
import com.nondo.dean.auth.domain.RoleAuthorityKey;
import com.nondo.dean.common.mybatis.Table;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.session.RowBounds;
import org.apache.ibatis.type.JdbcType;

@Table("auth_role_authority")
@Mapper
public interface RoleAuthorityMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table auth_role_authority
     *
     * @mbg.generated Fri Jun 08 10:55:45 CST 2018
     */
    @SelectProvider(type=RoleAuthoritySqlProvider.class, method="countByExample")
    long countByExample(RoleAuthorityExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table auth_role_authority
     *
     * @mbg.generated Fri Jun 08 10:55:45 CST 2018
     */
    @DeleteProvider(type=RoleAuthoritySqlProvider.class, method="deleteByExample")
    int deleteByExample(RoleAuthorityExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table auth_role_authority
     *
     * @mbg.generated Fri Jun 08 10:55:45 CST 2018
     */
    @Delete({
        "delete from auth_role_authority",
        "where role_id = #{roleId,jdbcType=BIGINT}",
          "and authority_id = #{authorityId,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(RoleAuthorityKey key);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table auth_role_authority
     *
     * @mbg.generated Fri Jun 08 10:55:45 CST 2018
     */
    @Insert({
        "insert into auth_role_authority (role_id, authority_id)",
        "values (#{roleId,jdbcType=BIGINT}, #{authorityId,jdbcType=BIGINT})"
    })
    int insert(RoleAuthorityKey record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table auth_role_authority
     *
     * @mbg.generated Fri Jun 08 10:55:45 CST 2018
     */
    @InsertProvider(type=RoleAuthoritySqlProvider.class, method="insertSelective")
    int insertSelective(RoleAuthorityKey record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table auth_role_authority
     *
     * @mbg.generated Fri Jun 08 10:55:45 CST 2018
     */
    @SelectProvider(type=RoleAuthoritySqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="role_id", property="roleId", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="authority_id", property="authorityId", jdbcType=JdbcType.BIGINT, id=true)
    })
    List<RoleAuthorityKey> selectByExampleWithRowbounds(RoleAuthorityExample example, RowBounds rowBounds);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table auth_role_authority
     *
     * @mbg.generated Fri Jun 08 10:55:45 CST 2018
     */
    @SelectProvider(type=RoleAuthoritySqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="role_id", property="roleId", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="authority_id", property="authorityId", jdbcType=JdbcType.BIGINT, id=true)
    })
    List<RoleAuthorityKey> selectByExample(RoleAuthorityExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table auth_role_authority
     *
     * @mbg.generated Fri Jun 08 10:55:45 CST 2018
     */
    @UpdateProvider(type=RoleAuthoritySqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") RoleAuthorityKey record, @Param("example") RoleAuthorityExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table auth_role_authority
     *
     * @mbg.generated Fri Jun 08 10:55:45 CST 2018
     */
    @UpdateProvider(type=RoleAuthoritySqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") RoleAuthorityKey record, @Param("example") RoleAuthorityExample example);
}